package bb.lanxing.util.image;

import android.content.Context;
import android.widget.ImageView;

import bb.lanxing.R;
import bb.lanxing.common.config.ImagePostfix;

public class MedalImageLoadUtil {
    public static final int SHOW_MEDAL_TYPE_BIG = 1;
    public static final int SHOW_MEDAL_TYPE_NORMAL = 0;
    public static final int SHOW_MEDAL_TYPE_NO_POSTFIX = 3;
    public static final int SHOW_MEDAL_TYPE_SMALL = 2;

    public static void showMedal(Context context, String str, ImageView imageView, int i) {
        if (i == SHOW_MEDAL_TYPE_NORMAL) {
            showMedal(context, str, imageView, ImagePostfix.CDN_IMAGE_TYPE_MEDAL_LIST_GENDERAL);
        } else if (i == SHOW_MEDAL_TYPE_BIG) {
            showMedal(context, str, imageView, ImagePostfix.CDN_IMAGE_TYPE_MEDAL_BIG_GENERAL);
        } else if (i == SHOW_MEDAL_TYPE_SMALL) {
            showMedal(context, str, imageView, ImagePostfix.UPYUN_IMAGE_TYPE_MEDAL_SMALL);
        } else if (i == SHOW_MEDAL_TYPE_NO_POSTFIX) {
            showMedal(context, str, imageView, (String) null);
        }
    }

    private static void showMedal(Context context, String str, ImageView imageView, String str2) {
        String addPostfix = GlideUtils.companion.addPostfix(str, str2);
        if (context == null) {
            context = imageView.getContext();
        }
        GlideUtils.companion.loadImage(context, addPostfix, imageView, R.drawable.ic_default, R.drawable.ic_default);
    }
}